﻿using System;
using System.Configuration.Provider;
 

namespace FileMonitor.Service.Provider.FileMonitor
{
    public sealed class FileProcessProviderCollection : ProviderCollection
    {
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (!typeof(FileMonitorBase).IsAssignableFrom(provider.GetType()))
            {
                throw new ArgumentException("Provider_must_implement_type:" + typeof(FileMonitorBase).ToString(), "provider");
            }
            base.Add(provider);
        }
        public void CopyTo(FileMonitorBase[] array, int index)
        {
            base.CopyTo(array, index);
        }
        new public FileMonitorBase this[string name]
        {
            get
            {
                return (FileMonitorBase)base[name];
            }
        }

    }
}
